package com.zyh.system.userinfo.controller;

import com.zyh.system.userinfo.domain.User;
import com.zyh.system.userinfo.service.impl.UserInfoServiceImpl;

import java.util.LinkedList;
import java.util.Scanner;

/**
 * @Author zyh
 * @Date 2024/7/31 19:13
 * @Description 公民身份管理系统首页
 */

public class UserInfoIndex {
    public static final Scanner INPUT = new Scanner(System.in);
    public static final UserInfoServiceImpl serviceImpl=new UserInfoServiceImpl();
    public static final LinkedList<User> deque=new LinkedList<>();

    public static void main(String[] args) {
        while (true) {
            System.out.println("-----------公民身份管理系统----------");
            System.out.println("\t\t\t1.信息录入");
            System.out.println("\t\t\t2.信息查询");
            System.out.println("\t\t\t3.信息修改");
            System.out.println("\t\t\t4.信息删除");
            System.out.println("\t\t\t5.退出");
            System.out.println("------------------------------------");
            System.out.println("--请选择--");
            int choice = INPUT.nextInt();
            switch (choice){
                case 1://信息录入
                    serviceImpl.addUserInfo(deque);
                    break;
                case 2://信息查询
                    serviceImpl.showUserInfo(deque);
                    break;
                case 3://信息修改
                    serviceImpl.updateUserInfo(deque);
                    break;
                case 4://信息删除
                    serviceImpl.deleteUserInfo(deque);
                    break;
                default://退出
                    System.out.println("系统退出！");
                    System.exit(0);
            }
        }
    }
}
